<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>水平垂直居中</title>
    <style>
        body{
            margin: 0;
            padding: 0;
        }
        *{
            box-sizing: border-box;
        }
        .k{
            width: 80vw;
            height: 80vh;
            background-color: lightblue;
            margin: auto;
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
    <div class="k"></div>
</body>
</html>